<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>病案图像制作图片浏览页</title>
</head>
<body>
	<div class="easyui-panel" id="shoot_panel" data-options="fit:true,border:0" style="width:100%;height:100%;">
		<div id="shootLayout" class="easyui-layout" data-options="fit:true">
			<!-- 左边树菜单 -->
			<div id='westTree' data-options="region:'west',split:true" style="width:20%;height:100%;border-left:0;">
				<p style="text-align:center;">
					<label id="fname" class="shootFontBold"></label>&nbsp;
					<label>(病案号: </label><label id="fprn" class="shootFontBold"></label><span>)</span>
					<span id="currentIndex" style="display:none;"></span><!-- 保存当前选中的树节点元素下标值 -->
				</p>
				<ul id="shootTree" ></ul>
			</div>
			<div id="shoot_center" data-options="region:'center',split:true" style="width:50%;height:100%">
				<!-- <div class="slide_container" > -->
				     <div id="shootSlider" ></div>
			    <!-- </div> -->
			          <!-- 遮盖层 star-->
					  <div id="shoot_bgSliderIMG" class="bgSliderIMG"> 
						 <img src="<%=request.getContextPath()%>/image/closed.png" style="float:right;cursor: pointer;" onclick="closed()">
					  </div>
					  <div id="shoot_SliderIMG" class="SliderIMG"></div>
					  <!-- 遮盖层 end--> 
			 </div>
			<!-- 拍摄区域 -->
			<div id="shoot_east" data-options="region:'east',split:true" style="width:30%;height:100%"> 
				<!-- 高拍仪拍摄区域 start-->
				<div  align="center" style="width:100%;height:100%;overflow:hidden;">
				    <div id="camero" style="width: 100%;height: 100%;" align="center">
						  <div style="width:100%;height:100%" align="center">
							<object id="Capture" style ="width: 100%;height: 100%;" align="center" classid="clsid:9A73DB73-2CA3-478D-9A3F-7E9D6A8D327C">
							<!-- 如果要指定cab包和/或版本号参照以下示例 -->
							<!-- object id="Capture" style ="width: 99%;height: 550px;border: 5 gray solid;" align="middle" classid="clsid:9A73DB73-2CA3-478D-9A3F-7E9D6A8D327C" codebase="CaptureVideo.cab#version=1,7,8,0" -->
						    </object>
					      </div>
					</div>
					<!-- <div class="slide_container" style="display:none;">
					      <div id="shootSlider"></div>
					      <ul id="shootSlider" class="rslides"> </ul> 
				    </div> -->
	  			</div>
	  			<!-- 高拍仪拍摄区域 end-->
		   </div>
		   <!-- 底部工具栏 start-->
		   <div data-options="region:'south'" style="width:100%;height:75px;" class="Cancel_borderLB">
		        <span style="display:none;">
					 <label>您现在正在翻拍病案</label>&nbsp;&nbsp;
					 <label>病案号: </label><label id="fprn" class="shootFontBold"></label>
					 <label>住院次数: </label><label id="ftimes" class="shootFontBold"></label>&nbsp;&nbsp;
					 <label>住院ID: </label><label id="fzyid" class="shootFontBold"></label>&nbsp;&nbsp;
					 <label>姓名: </label><label id="fname" class="shootFontBold"></label>&nbsp;&nbsp;
					 <label>出院日期: </label><label id="shootFcydate" class="shootFontBold"></label>&nbsp;&nbsp;
					 <label>条码号: </label><label id="shootFbarcode" class="shootFontBold"></label>
			    </span> 
			    <div class="paddingTBL">  
			            <label>病案号&nbsp;</label>
	       				<input id="shootFprnInput" class="easyui-searchbox" data-options="prompt:'条码号/住院号',iconWidth:35" style="height:24px;" />
					    <span class="paddingbtn"></span>
					    <span class="spansplit">
			              <img src="<%=request.getContextPath()%>/image/icons/separated.png">
			            </span> 
			            <span id="archivingButton"  class="spanbtn sbtnWidth" onclick ="archivingOperation()">
			              <img src="<%=request.getContextPath()%>/image/icons/upload.png"><br/>归档
			            </span> 
						<span id="openButton" class="spanbtn sbtnWidth" onclick ="OpenDevice(CammeraType.value)">
			              <img src="<%=request.getContextPath()%>/image/icons/shoot.png"><br/>打开高拍仪  1
			            </span> 
			            <span id="shootButton" class="spanbtn sbtnWidth" onclick ="CaptureToFile()">
			              <img src="<%=request.getContextPath()%>/image/icons/shoot.png"><br/>拍摄  F2
			            </span> 
			            <span id="rotationButton" class="spanbtn sbtnWidth" onclick ="SetDeviceRotation(90)">
			              <img src="<%=request.getContextPath()%>/image/icons/rotating.png" style="width:25px;"><br/>旋转  3
			            </span> 
			            <span  class="spansplit">
			              <img src="<%=request.getContextPath()%>/image/icons/separated.png">
			            </span> 
			            
			            <span id="shoot" class="spanbtn sbtnWidth" onclick ="transfer()">
			              <img src="<%=request.getContextPath()%>/image/icons/upload.png"><br/>传送  5
			            </span> 
			            <span class="spansplit">
			              <img src="<%=request.getContextPath()%>/image/icons/separated.png">
			            </span> 
			            
			            <span id="insertButton" class="spanbtn sbtnWidth" onclick ="append()">
			              <img src="<%=request.getContextPath()%>/image/icons/insert.png"><br/>插入  4
			            </span> 
			            <span id="repeatButton" class="spanbtn sbtnWidth" onclick ="repeat()">
			              <img src="<%=request.getContextPath()%>/image/icons/remake.png" style="width:20px;"><br/>重拍  2
			            </span> 
			            <span id="removeButton" class="spanbtn sbtnWidth" onclick ="remove()">
			              <img src="<%=request.getContextPath()%>/image/icons/delete.png"><br/>删除  6
			            </span>
			            <span class="spansplit">
			              <img src="<%=request.getContextPath()%>/image/icons/separated.png">
			            </span>  
			            
			            <span id="paramButton" class="spanbtn sbtnWidth" style="width:125px;">
				            <input type="checkbox" name="checkReduceShadow" id="print_" onclick="SetResuceShadow()"/>
							<label class="generalFont">去除阴影&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><br/>
							<input type="checkbox" name="checkRepairDistortion" id="checkRepairDistortion" onclick="SetRepairDistortion()"/>
							<label  class="generalFont">文档变形修补</label>
						</span>
						<span class="spansplit">
			              <img src="<%=request.getContextPath()%>/image/icons/separated.png">
			            </span> 
			          
			           <%--  <span id="" class="spanbtn sbtnWidth" onclick ="openShootDialog()">
			              <img src="<%=request.getContextPath()%>/image/icons/list.png"><br/>审核
			            </span> 
			            <span class="spansplit">
			              <img src="<%=request.getContextPath()%>/image/icons/separated.png">
			            </span> --%>
			            
			         <%--    <span id="" class="spanbtn sbtnWidth" onclick ="">
			              <img src="<%=request.getContextPath()%>/image/icons/prev.png" style="width:20px;"><br/>上一页
			            </span> 
			            <span id="" class="spanbtn sbtnWidth" onclick ="">
			              <img src="<%=request.getContextPath()%>/image/icons/next.png" style="width:20px;"><br/>下一页
			            </span> 
			            <span class="spansplit">
			              <img src="<%=request.getContextPath()%>/image/icons/separated.png">
			            </span> --%>
			            
			            <span id="closeId" class="spanbtn sbtnWidth" onclick ="Close_Shoot_Dialog()">
			              <img src="<%=request.getContextPath()%>/image/icons/close.png"><br/>关闭
			            </span>  
			            
						<!-- 高级设置部分 --> 
						<label style="display:none;">分辨率:</label>
						<select id="Resolution_Select" name="Resolution" style="width:100px;display:none;" ></select>
						<select name="CammeraType" id="CammeraType" style="width:100px; font-size:12px;display:none;">
				          <option value ="0" selected="selected">文档摄像头</option>
				          <option value ="1">人像摄像头</option>
				          <option value ="2">双摄像头</option>
				        </select>
				         <!-- 条形码 -->
					    <input type="checkbox" name="checkBarcode" id="checkBarcode" style="display:none;"/>
					    <!--标记为多页源 -->
				        <input type="checkbox" style="display:none;" name="checkMultiSource" id="checkMultiSource"/>
				        <textarea name="content" cols="30" rows="6" id="content" style="display:none;width:95%; border: 1 solid #888888;LINE-HEIGHT:18px;padding:3px; font-size:12px"></textarea>
			            
			      </div>
			</div>
			<!-- 底部工具栏 end-->
	   </div>
   </div> 
	

<%-- <script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery/plug/slides/responsiveslides.min.js"></script>
<script type="text/javascript" src='<%=request.getContextPath()%>/script/jquery/plug/viewer/jquery.js'></script> 
<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery/plug/viewer/jqueryui.js" ></script>
<script type="text/javascript" src='<%=request.getContextPath()%>/script/jquery/plug/viewer/jquery.mousewheel.min.js'></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery/plug/viewer/jquery.iviewer.js"></script> --%>

<script type="text/javascript" src="<%=request.getContextPath()%>/js/ShootRecord/Shoot.js"></script>
<script type="text/javascript">
	$("#fprn").html('<%=request.getParameter("fprn")%>');
	$("#fzyid").html('<%=request.getParameter("fzyid")%>');
	$("#ftimes").html('<%=request.getParameter("ftimes")%>');
	$("#fname").html(decodeURI('<%=request.getParameter("fname")%>'));
	$("#shootFcydate").html('<%=request.getParameter("fcydate")%>');
	$("#shootFbarcode").html('<%=request.getParameter("fbarcode")%>');
	var tag = '<%=request.getParameter("tag")%>'; 
	var dialog = '<%=request.getParameter("dialog")%>';  //传入当前dialog ID
	$(function(){
		init();
		
	});
	//初始化高拍仪
	function init(){
		try{
			Content = document.getElementById("content");//获取文本框对象
			Capture = document.getElementById("Capture");//根据js的脚本内容，必须先获取object对象
			ResSelect = document.getElementById("Resolution_Select");//获取分辨率select标签的object对象
		}catch(err){
			alert("未找到ICaptureVideo.ocx控件，请重新安装!");
		}
	} 
	<%-- //标识符;用于标识不同页面调用此页面，并开放对应的权限操作。
	//0 ：拍摄页面调用
	//1:归档页面调用
	//2:浏览图片时调用
	
	//根据当前标识符，开放对应的权限
	switch(tag){
		case "0":
			$("#archivingButton").css("display","none");
			$("#openButton").css("display","");
			$("#shootButton").css("display","");
			$("#shoot").css("display","");
			$("#rotationButton").css("display","");
			$("#insertButton").css("display","");
			$("#repeatButton").css("display","");
			$("#removeButton").css("display","");
			$("#paramButton").css("display","");
			break;
		case "1":
			$("#shoot_center").css({"width":"80%"});
			$("#shoot_east").css({"width":"0px","display":"none"});
			$("#archivingButton").css("display","");
			$("#openButton").css("display","none");
			$("#shootButton").css("display","none");
			$("#shoot").css("display","none");
			$("#rotationButton").css("display","none");
			$("#insertButton").css("display","none");
			$("#repeatButton").css("display","none");
			$("#removeButton").css("display","none");
			$("#paramButton").css("display","none");
			$(".spansplit:eq(1) , .spansplit:eq(2) , .spansplit:eq(3)").css("display","none");
			break;
		case "2":
			$("#shoot_center").css({"width":"80%"});
			$("#shoot_east").css({"width":"0px","display":"none"});
			$("#archivingButton").css("display","none");
			$("#openButton").css("display","none");
			$("#shootButton").css("display","none");
			$("#shoot").css("display","none");
			$("#rotationButton").css("display","none");
			$("#insertButton").css("display","none");
			$("#repeatButton").css("display","none");
			$("#removeButton").css("display","none");
			$("#paramButton").css("display","none");
			$(".spansplit:eq(1) , .spansplit:eq(2) , .spansplit:eq(3)").css("display","none");
			break;
	}
	 --%>
	$("#shootTree").tree({
		url : ctx + "/MedicalShootManage/tree",
		animate : true,
		checkbox : false,
		queryParams : {
			"fzyid" : $("#fzyid").text()
		},
		onSelect:function(node){
			if(node.text != "病案封面"){
		    	//点击分为两种情况：情景一，直接点击图片;情景二：点击二级菜单;
		    		if(!node.children){//情景一
		    			var src = node.attributes;
		    			var isMore = false; //为false，则表示单张图片
		    			var Parent = $("#shootTree").tree("getParent",node.target);
		    			$("#currentModel").html(Parent.text);
		    			$.ajax({
		    				url: ctx + "/MedicalShootManage/encodeIMG",
		    				dataType : 'json',
		    				type : 'post',
		    				data:{
		    					"path" : src,
		    					"isMore" : isMore
		    				},
		    				success:function(){
		    					putImg(node);
		    				},
		    				error:function(){
		    					$.messager.alert("提示","解密图片失败,请联系管理员！","info");
		    				}
		    			});
		    		}else{ //情景二
		    			//如果当前二级菜单没有任何图片，则不执行以下方法
		    			if(node.children.length > 0){ 
		    				putImg2(node);
		    			}else{
		    				return;
		    			}
		    		}
			}
		}
	});

	
</script>
</body>
</html>